import { request } from '@/utils'

export default {
  // 无人机控制
  controlUAV(rotorTypeId, detectionType) {
    return request.post('/detection/control', {
      rotor_type_id: Number(rotorTypeId),
      detection_type: Number(detectionType)
    })
  },

  // 开始检测
  startDetection(data) {
    return request.post('/detection/start', data)
  },

  // 停止检测
  stopDetection(detectionId) {
    return request.post('/detection/stop', {
      detection_id: Number(detectionId)
    })
  },

  // 获取检测记录的图片列表
  getDetectionImages(detectionId) {
    return request.post('/detection/images', {
      detection_id: Number(detectionId)
    })
  },

  // 获取检测记录列表
  getDetectionList(params) {
    return request.get('/detection/list', { params })
  },
  // 获取操作员列表
  getOperatorList() {
    return request.get('/user/list')
  },

  // 添加获取视频路径的接口
  getDetectionVideo(detectionId) {
    return request.post('/detection/video', {
      detection_id: Number(detectionId)
    })
  }
} 